<?php
use Phalcon\Di;

$searchProject = Di::getDefault()->getShared('config')->cache('searchProject');
$searchProjectOptions = [];
foreach ($searchProject as $key => $item){
    $searchProjectOptions[$key] = $item['name'];
}
return [
    'xunsearch' => [
        'widget' => 'Selects',
        'access' => [
            'addForm' => true,
            'editForm' => true,
        ],
        'options' => $searchProjectOptions,
        'label' => 'Xunsearch项目初始化',
        'description' => '重新创建选中的xunsearch项目配置文件，但不重置索引',
        'error' => '',
        'attributes' => [
            'class' => 'form-control',
        ],
        'filter' => ['boolval'],
    ],
    'xunsearch_rebuild' => [
        'widget' => 'Selects',
        'access' => [
            'addForm' => true,
            'editForm' => true,
        ],
        'options' => $searchProjectOptions,
        'label' => 'Xunsearch索引重建',
        'description' => '重新生成选中Xunsearch项目搜索索引',
        'error' => '',
        'attributes' => [
            'class' => 'form-control',
        ],
        'filter' => ['boolval'],
    ],
];